{if $vpt_context}
    <a href="{$ret}?manage={$vpage->get_id()}" class="action_back">Back to virtual page &quot;{$vpage->get_path()}&quot;</a><br /><br />    
{else}
    {if $vpage}    
	    <a href="admin/modules/tangra_cms/vpage/vpage_manage.php?manage={$vpage->get_id()}" class="action_back">Back to virtual page &quot;{$vpage->get_path()}&quot;</a><br /><br />
	{/if}
    
    {if $ret}
    <a href="{$ret}?manage={$ci_id}" class="action_back">Back to content item {if $ci_title}&quot;{$ci_title|truncate:100}&quot;{/if} with ID {$ci_id}</a><br />
    <br />
    {/if}
{/if}

  <!-- *** CUT top -->
  <table width="800"  border="0" cellspacing="0" cellpadding="0" class="form" id="image_upload_top_table">
    <tr>
      <td align="left">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
              <div class="form_title">Upload image</div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <!-- If you don't want notes erase this START -->
    <tr>
      <td>
        <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="form_note">
          <!-- Repeat this fo additional notes START -->
          <tr>
            <td valign="top" align="left">
              <table width="100%"  border="0" cellspacing="0" cellpadding="4" class="form_note_title">
                <tr>
                  <td><img src="img/modules/form_html_tpl_static_ajax_metallic/exclamation_mark.png" border="0" alt="icon exclamation mark"  width="16" height="16" /></td>
                  <td width="100%" align="left">Note:</td>
                </tr>
              </table>
            </td>
            <td align="left" width="99%">
              <div class="form_note_text">Fields marked with &quot;*&quot; are mandatory.</div>
            </td>
          </tr>
          <!-- Repeat this fo additional notes END-->
        </table>
      </td>
    </tr>
    <!-- If you don't want notes erase this END -->
    <tr>
      <td>
        <div id="image_upload">
          <form action="admin/modules/tangra_cms/image/image_upload.php" method="post" name="image_upload_form" enctype="multipart/form-data">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left">
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="form_row">
                    <tr>
                      <td class="form_even_row">
                        <!-- form_field_file image_upload_image START-->
                        <table width="100%" border="0" cellpadding="3" cellspacing="0" class="form_row">
                          <tr>
                            <td width="180">
                              <div align="right">Image file*:</div>
                            </td>
                            <td width="1%">
                              <input type="hidden" name="MAX_FILE_SIZE" value="{$image_upload_image_mfs}" />
                              <input class="form" name="image_upload_image" type="file" id="image_upload_image" size="70" />
                            </td>
                            <td>&nbsp;</td>
                          </tr>
                          {if $image_upload_image_has_error}
                          <!-- Potential errors START -->
                          {if $image_upload_image_error_mandatory_missing}
                          <!-- mandatory_missing START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: Field is mandatory.</div>
                            </td>
                          </tr>
                          <!-- mandatory_missing END -->
                          {/if}
                          {if $image_upload_image_error_size_exceeded}
                          <!-- size_exceeded START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: Uploaded file exceeds allowed size of {$maximum_size_allowed/1024|string_format:"%.2f"} KiB. </div>
                            </td>
                          </tr>
                          <!-- size_exceeded END -->
                          {/if}
                          {if $image_upload_image_error_partial_upload}
                          <!-- partial_upload START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: The uploaded file was only partially uploaded.</div>
                            </td>
                          </tr>
                          <!-- partial_upload END -->
                          {/if}
                          {if $image_upload_image_error_invalid_file}
                          <!-- invalid_file START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: {include  file="modules/tangra_cms/forms/field_errors/image_upload/`$_language`/field_error_invalid_file_`$_language`.tpl"}</div>
                            </td>
                          </tr>
                          <!-- invalid_file END -->
                          {/if}
                          {if $image_upload_image_error_invalid_extension}
                          <!-- invalid_extension START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: {include  file="modules/tangra_cms/forms/field_errors/image_upload/`$_language`/field_error_invalid_extension_`$_language`.tpl"}</div>
                            </td>
                          </tr>
                          <!-- invalid_extension END -->
                          {/if}
                          {if $image_upload_image_error_maximum_width_exceeded}
                          <!-- maximum_width_exceeded START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: {include  file="modules/tangra_cms/forms/field_errors/image_upload/`$_language`/field_error_maximum_width_exceeded_`$_language`.tpl"}</div>
                            </td>
                          </tr>
                          <!-- maximum_width_exceeded END -->
                          {/if}

                          {if $image_upload_image_error_maximum_height_exceeded}
                          <!-- maximum_height_exceeded START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: {include  file="modules/tangra_cms/forms/field_errors/image_upload/`$_language`/field_error_maximum_height_`$_language`.tpl"}</div>
                            </td>
                          </tr>
                          <!-- maximum_height_exceeded END -->
                          {/if}
                          {if $image_upload_image_error_xy_invalid_ratio}
                          <!-- xy_invalid_ratio START -->
                          <tr>
                            <td></td>
                            <td colspan="2">
                              <div class="form_error_message">Error: {include  file="modules/tangra_cms/forms/field_errors/image_upload/`$_language`/field_error_xy_invalid_ratio_`$_language`.tpl"}</div>
                            </td>
                          </tr>
                          <!-- xy_invalid_ratio END -->
                          {/if}
                          <!-- Potential errors END -->
                          {/if}
                        </table>
                        <!-- form_field_file image_upload_image END-->
                      </td>
                    </tr>
                  </table>
                  <input type="hidden" name="image_upload_form_id" value="{$image_upload_form_id_val}" id="image_upload_form_id"/>
                  <input type="hidden" name="image_upload_guard_value" value="{$image_upload_guard_value_val}" id="image_upload_guard_value"/>
                </td>
              </tr>
              <tr>
                <td align="left">
                  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="submit_row">
                    <tr>
                      <td width="180">&nbsp;</td>
                      <td width="100" align="left">
                        <input name="image_upload_submit" type="submit" value="Upload" class="form_submit" />
                      </td>
                      <td width="50">&nbsp;</td>
                      <td>
                        <div class="form_cancel">
                        	{if $ci_id && $ret}
                            	{if $back_to_select}
	                                <a href="admin/modules/tangra_cms/ci/ci_images.php?ci={$ci_id}">
                                {else}
                                    <a href="{$ret}?manage={$vpage->get_id()}">
                                {/if}
                            {else}
  	                        	<a href="admin/modules/tangra_cms/image/images.php">
                            {/if}Cancel</a></div>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </form>
        </div>
      </td>
    </tr>
  </table>
  <!-- *** CUT bottom -->
